New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement CPU usage reduction feature #12614
Conversation
Improved it so even higher values can be used without frame drops. |
8386078
to
00e208a
Compare
You need FPS limiter enabled if it's not capped by the game, also it takes a minute or a few to see results. (slowly reduces CPU usage) |
Understood, I'm just showing the QT layout looks broke. Nice to know this is dynamic. Thank you that'll help too. |
RPCS3.log |
Well the more CPU preemptions, the more effect this pr has, so 0 is no effect at all. |
And another factor is the CPU usage so that needs to be observed too. And 15 minutes is fine as well. |
My thought pattern is along the lines the lighter it is on the hardware the better the results will be because if you're not able to achieve the fps limit you won't get anything. |
It's because it doesn't use SPUs. (0 usage) |
In my opinion this implementation is a bit too complicated for the end user who will not understand what the option even does. We can move it to advanced tab, but that doesn't achieve the goal here. We really should have just had something easy to tune, a simple "low power mode" checkbox that limits fps to 30 or 60 and calibrates pre-emptions automatically. Even the description of the CPU pre-emptions doesn't help the average user here, they will simply not use it. |
There must be some user interaction with it, it can't be trimmed down to something like "enabled/disabled" because it can't predict gameplay sections which suddenly are way more demanding than others, in this case an FPS drop can occur until it readjusts itself. But this is a problem the user can solve by looking at the log and seeing what values it actually ends up using after the performance drop and setting it to the global max value. Same for audio issues at high values - something we can't detect but the user can. Also "inactive rendering" detection doesn't really work for audio or loading screens (in loading not much rendering occurs but the PPU/SPU are fully active, so in this case loading is lengthen much if using rendering-based adjustments) either and it breaks down horribly, it needs to be spaced-out equally along the frame time to prevent issues. |
This diminishes the usability drastically. Users are trying to "pick up and play" and will usually not do things like looking at logs to optimize performance. That's something developers do, not gamers. |
Made this setting much less obscure and recommends values less than 50 so most of the users won't need to do much thinking with it. Also, maximum value has been reduced to 300. |
Improved analysis to make FPS drops much shorter even on high values and made logging more useful for users who do want to tinker with it. |
90243b0
to
9f0f572
Compare
83716a6
to
ac2720d
Compare
e4994b4
to
3a1a93d
Compare
This could probably even improve performance on some devices that are thermally limited. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
This seems to cause visual corruption in Ni No Kuni when set to 25 & you're in the Dark Forest area. Here's a save file for testing. Should be immediately apparent, it looks like portions of assets blink out of existence for a frame. |
@Nicholas-Steel Hi, try to set "Allow RSX CPU Preemptions: false" in game config file when using this feature. |
@elad335 That had no effect. This is what it looks like: https://www.youtube.com/watch?v=0j38bggAkp0 config_BLUS30947.zip (the change elad335 mentioned is not present in this copy of the config but I did test it) |
Emulation poses a problem when it runs on the host system because the emulated programs are not optimized for the host system which often creates issues. A common pattern is that coded CPU sleep is adjusted to the console's performance and oftentimes reduced to a minimum because it benefits much less when the game is the only application the console is optimized to run. (doesn't need to care about the performance of other applications while it's running). This is especially an issue on older consoles or CELL SPU emulation where CPU sleep is barely supported by the hardware. This means that even when emulating on strong hardware which can be 100 times faster than the original console, CPU usage is often high even when the FPS never drops.
High CPU usage often means fast battery drainage, reduced performance of multitasking, hot hardware temperatures, etc etc.
Implemented a setting to add planned CPU short sleep calls to all the emulation threads when the target FPS is hit to solve this problem. (needs FPS to be locked either by game or RPCS3)
It does this by using per-frame performance analysis and slowly readjusting CPU sleep calls count to be best for your hardware. This means improved experience when using RPCS3 on mobile devices such as the Steam Deck or laptops. Do note that high values for it may cause audio issues or sudden FPS drops, in this case, lower its value. This setting is called "Max CPU Preempt Count" and is found on CPU tab (disabled/0 by default).